package com.example.module.sys.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.io.Serializable;
import java.time.LocalDateTime;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

/**
 * <p>
 * 系统管理员表
 * </p>
 *
 * @author Administrator
 * @since 2021-11-13
 */
@Getter
@Setter
@Accessors(chain = true)
@TableName("sys_admin")
public class Admin extends Model<Admin> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 账号
     */
    private String account;

    private String username;

    private String nickname;

    private String password;

    private String salt;

    private String mobile;

    private String email;

    private String avatar;

    private LocalDateTime lastLoginTime;

    private Integer status;

    @TableField(fill = FieldFill.INSERT)
    @TableLogic
    private Integer enable;

    private Integer createUser;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime createTime;

    private Integer updateUser;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime updateTime;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    @Version
    private Long version;


    @Override
    public Serializable pkVal() {
        return this.id;
    }

}
